import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/home',
      component: resolve => require(['../components/common/Home.vue'], resolve),
      name: 'home',
      children:[
        {
          path: '/',
          component: resolve => require(['../components/page/Index.vue'], resolve),
          meta: { requiresAuth: true }
        },
        {
          path: '/demo',
          component: resolve => require(['../components/page/demo.vue'], resolve),
          meta: { requiresAuth: true }
        },
      ]
    },
    {
      path: '/login',
      component: resolve => require(['../components/page/Login.vue'], resolve)
    },
]
})
